package com.karrim.server.io.sql;

import com.google.inject.Inject;
import com.karrim.server.io.sql.util.Table;
import java.sql.SQLException;

/**
 *
 * @author andrea.cantafio
 */
public class MySQLLoader extends AbstractSQLLoader<MySQLConnector> {

    @Inject
    public MySQLLoader(MySQLConnector connector) {
        super(connector);
    }

    @Override
    public Table getTableDefinition(String table) throws SQLException {
        return getTableDefinition(load("SELECT * FROM " + table + " LIMIT 1;").getMetaData());
    }

    @Override
    public String[] getTableNames() throws SQLException {
        return getTableNames("SHOW TABLES;");
    }

}
